package com.msa.msaportal.dao.impl;
import com.msa.msaportal.common.hibernate.HibernateSimpleDao;
import com.msa.msaportal.dao.IFooterDao;
import com.msa.msaportal.entity.Portalfooter;

   public class FooterDaoImpl  extends HibernateSimpleDao implements  IFooterDao {

	@Override
	public void addFooter(Portalfooter footer) {
		
		this.sessionFactory.getCurrentSession().save(footer);
		
	}


	@Override
	public void delete(String footerId) {
		String hql="from Portalfooter where fsource_id=?";
		Portalfooter footer=(Portalfooter)super.findUnique(hql, footerId);
		System.out.println(footer);
		System.out.println(footer);
		System.out.println(footer);
		/*Integer id = Integer.valueOf(footerId);
		Footer footer= (Footer) this.sessionFactory.getCurrentSession().load(Footer.class,id);*/
		
		if (footerId!=null) {
		this.sessionFactory.getCurrentSession().delete(footer);
		}
		  
		
	}
	
	 public  Portalfooter find(String footerId) {
		String hql="from Portalfooter where fsource_id=?";
		Portalfooter footer=(Portalfooter)super.findUnique(hql, footerId);		
		return  footer;
	
}


	@Override
	public void update(Portalfooter footer) {
		// TODO Auto-generated method stub
		this.getSession().update(footer);
		
	}
	
	
	
}
